package top.z.work.module.system.controller.user.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import top.z.work.framework.common.constant.DataStatus;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@Schema(description = "系统管理 - 创建用户数据 VO")
public class SystemUserCreateVO {

    @NotNull(message = "部门ID不能为空")
    @Schema(description = "部门ID", example = "9527")
    private Long deptId;

    @Length(min = 2, max = 50, message = "登录账号长度只能在 2 到 50 个字符之间")
    @NotNull(message = "登录账号不能为空")
    @Schema(description = "登录账号", example = "test")
    private String username;

    @Length(min = 2, max = 50, message = "账号名称长度只能在 2 到 50 个字符之间")
    @NotNull(message = "账号名称不能为空")
    @Schema(description = "账号名称", example = "张三")
    private String nickname;

    @Length(min = 11, max = 11, message = "手机号长度只能是11个字符")
    @NotNull(message = "手机号不能为空")
    @Schema(description = "手机号", example = "13100000000")
    private String mobile;

    @Min(value = 0, message = "状态只能是 0 或者 1")
    @Max(value = 1, message = "状态只能是 0 或者 1")
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态", example = "0", implementation = DataStatus.class)
    private Integer status;

    @Schema(description = "登录IP", example = "127.0.0.1")
    private String loginIp;

    @Schema(description = "登录时间", example = "2099-12-31 23:59:59")
    private LocalDateTime loginTime;

}
